package org.example.DAO;

import org.example.entity.User;
import java.sql.SQLException;

public interface UserDao {
    // 检查用户名是否存在
    boolean isUsernameExists(String username) throws SQLException;

    // 检查邮箱是否存在
    boolean isEmailExists(String email) throws SQLException;

    // 注册新用户
    boolean registerUser(User user) throws SQLException;

    // 根据用户名获取用户信息
    User getUserByUsername(String username) throws SQLException;

    // 更新用户信息
    boolean updateUserInfo(User user) throws SQLException;

    // 修改用户密码
    boolean changePassword(String username, String oldPassword, String newPassword) throws SQLException;

    boolean updatePassword(String account, String newPassword) throws SQLException;

    // 根据邮箱重置密码
    boolean resetPasswordByEmail(String email, String newPassword) throws SQLException;
}